package com.lagou.edu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @author yangpeng
 * @time 2020/3/15
 * @since 1.0.0
 */
@Controller
public class LoginController {

    @RequestMapping("/login")
    public String login(){
        return "redirect:/index.jsp";
    }

    @RequestMapping(value="/doLogin",method= RequestMethod.POST)
    public String doLogin(HttpServletRequest request,String username,String password){
        HttpSession session = request.getSession(true);
        session.setAttribute("username",username);
        return "redirect:resume/index";
    }
}
